package Multithreading.Lock;

import Multithreading.Exercise002.MyThread;

/**
 * ClassName:ThreadDome
 * Package:Multithreading.Lock
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/3/5-20:55
 * @Version:v1.0
 */
public class ThreadDome {
    public static void main(String[] args) {
        //需求：某电影院目前正在上映国产大片,共有100张票,而他有3个窗口买票,请设计一个程序模拟该电影院卖票

        //创建线程对象
        Multithreading.Exercise002.MyThread t1 = new Multithreading.Exercise002.MyThread();
        Multithreading.Exercise002.MyThread t2 = new Multithreading.Exercise002.MyThread();
        Multithreading.Exercise002.MyThread t3 = new MyThread();

        //起名字
        t1.setName("窗口1");
        t2.setName("窗口2");
        t3.setName("窗口3");

//        t1.setPriority(1);
//        t2.setPriority(5);
//        t3.setPriority(10);
        //开启线程
        t1.start();
        t2.start();
        t3.start();
    }
}
